// 登陆
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { baseTopicType,RecommendTopicResponseType } from './type'
import { homeRecommendTopicApi } from "@renderer/api/topic"

export const useTopicStore = defineStore('topic', () => {
    const recommendTopicList = ref<baseTopicType[]>([])
    const homeRecommendTopic = async () => {
        const res:RecommendTopicResponseType = await homeRecommendTopicApi()
        if(res.code == 0){
            recommendTopicList.value = res.result
            return res
        }
    }
    return {
        recommendTopicList,
        homeRecommendTopic,
    }
}
)